import os
# from langchain_community.chat_models import QianfanChatEndpoint
from langchain_community.chat_models import QianfanChatEndpoint
from langchain_core.messages import HumanMessage, SystemMessage

AK = '2jCwbiCWReSVlPbt53f9pYhP'
SK = 'dwJ8BULLCsBMXsmtjyxNI8hkw4y0HPXq'
os.environ['QIANFAN_AK'] = AK
os.environ['QIANFAN_SK'] = SK
# chat = QianfanChatEndpoint(streaming=True, model="BLOOMZ-7B")
chat=QianfanChatEndpoint(streaming=True,model='Qianfan-Chinese-Llama-2-7B')
message = [SystemMessage('你现在是一个金融从业者'), HumanMessage(content='给我预测一下2024年的美国股市的走向')]
res = chat(message)
print(res.content)
